#define _CRT_SECURE_NO_WARNINGS
#include "Queue.h"

void testQueue()
{
	struct Queue q;
	QueueInit(&q);
	QueuePush(&q, 1);
	QueuePush(&q, 2);
	QueuePush(&q, 3);
	QueuePush(&q, 4);
	QueuePush(&q, 5);
	while (!QueueEmpty(&q))
	{
		printf("%d ", QueuePop(&q));
	}
	printf("\n");
	QueuePush(&q, 100);
	printf("head:%d\n", QueuePop(&q));
	QueueDestory(&q);
}

void testQueue2()
{
	struct Queue q;
	QueueInit(&q);
	QueuePush(&q, 1);
	QueuePush(&q, 2);
	QueuePush(&q, 3);
	QueuePush(&q, 4);
	QueuePush(&q, 5);

	printf("Rear:%d\n", QueueBack(&q));
	printf("head:%d\n", QueueFront(&q));
	printf("Pop:%d\n", QueuePop(&q));
	printf("Rear:%d\n", QueueBack(&q));
	printf("head:%d\n", QueueFront(&q));
	printf("length:%d\n", QueueSize(&q));
	QueueDestory(&q);
	printf("Destroyed\n");
	printf("length:%d\n", QueueSize(&q));
}
int main()
{
	testQueue();
	printf("\n\n");
	testQueue2();
	return 0;
}